package com.zheng.oauthapi.controller;

import com.zheng.oauthapi.component.LoginUserHolder;
import com.zheng.oauthapi.domain.UserDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/hello")
public class UserController {
    @Autowired
    LoginUserHolder holder;

    @GetMapping("/currentUser")
    public UserDto currentUser() {
        return holder.getCurrentUser();
    }
}
